package com.lantosec.hmrp.modules.report.controller;

import com.lantosec.hmrp.core.kit.Result;
import com.lantosec.hmrp.core.mvc.BaseController;
import com.lantosec.hmrp.modules.report.service.IBusinessAnalysisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Api(value = "经分控制器", tags = "经分控制器")
@RestController
@RequestMapping("/report/business")
@Log4j2
public class BusinessAnalysisController extends BaseController {
    @Autowired
    private IBusinessAnalysisService iBusinessAnalysisService;

    @GetMapping("getJyfxChartsByMonthCd")
    @ApiOperation(value = "经分全院数据饼图报表")
    public Result<Map<String, Object>> getJyfxChartsByMonthCd(@ApiParam(value = "月份", required = true) @RequestParam(name = "month") String month){
        Map<String, Object> data = iBusinessAnalysisService.getHsptJyfxChartsByMonthCd(month);
        return Result.ok(data);
    }

    @GetMapping("getJyfxZyksGridByMonthCd")
    @ApiOperation(value = "经分各科室指标表格报表")
    public Result<List<Map<String, Object>>> getJyfxZyksGridByMonthCd(@ApiParam(value = "月份", required = true) @RequestParam(name = "month") String month){
        List<Map<String, Object>> data = iBusinessAnalysisService.getJyfxZyksGridByMonthCd(month);
        return Result.ok(data);
    }

}
